/**
 * Copyright (c) 2016-2019 九点科技 All rights reserved.
 *
 * http://www.9dyun.cn
 *
 * 版权所有，侵权必究！
 */
package com.dian.modules.sale.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.dian.common.validator.group.AddGroup;
import com.dian.common.validator.group.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.dian.common.entity.BaseEntity;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
/**
 * 销售发货单
 *
 * @author xiaolai
 * @email xiaolai@9dyun.cn
 * @date 2019-06-21 16:00:09
 */
@Data
@TableName("sale_deliver_head")
public class DeliverHeadEntity extends BaseEntity {
	private static final long serialVersionUID = 1L;

    /**
	 * 单据编码
	 */
    @NotBlank(message="单据编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="单据编码长度不能超过20个字符")
    private String deliverNo;



    /**
	 * 单据日期;format:yyyy-MM-dd;readonly
	 */
    @JsonFormat( pattern="yyyy-MM-dd")
    @NotNull(message="单据日期不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Date deliverDate;



    /**
	 * 预销售订单id;来源于sale_prob_head.id
	 */
    @NotNull(message="预销售订单id不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long probId;



    /**
	 * 预订单编码;来源于sale_prob_head.prob_no
	 */
    @NotBlank(message="预订单编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="预订单编码长度不能超过20个字符")
    private String probNo;



    /**
	 * 销售订单id;来源于sale_order_head.id
	 */
    @NotNull(message="销售订单id不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long orderId;



    /**
	 * 销售订单编码;来源于sale_order_head.order_no
	 */
    @NotBlank(message="销售订单编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="销售订单编码长度不能超过20个字符")
    private String orderNo;



    /**
	 * 门店id;来源于base_store.id
	 */
    @NotNull(message="门店id不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long storeId;



    /**
	 * 门店id;来源于base_store.store_name
	 */
    @NotBlank(message="门店名称不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=60,  groups ={AddGroup.class, UpdateGroup.class}, message="门店名称长度不能超过60个字符")
    private String storeName;



    /**
	 * 仓库Id;来源于Base_Warehouse.id
	 */
    @NotNull(message="仓库Id不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long warehouseId;



    /**
	 * 仓库编码;来源于Base_Warehouse.Warehouse_Code;readonly
	 */
    @NotBlank(message="仓库编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="仓库编码长度不能超过20个字符")
    private String warehouseCode;



    /**
	 * 仓库名称;来源于Base_Warehouse.Warehouse_Name
	 */
    @NotBlank(message="仓库名称不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="仓库名称长度不能超过40个字符")
    private String warehouseName;



    /**
	 * 客户ID;来源于base_customer.id
	 */
    @NotNull(message="客户ID不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long customerId;



    /**
	 * 客户编码;来源于base_customer.customer_code
	 */
    @NotBlank(message="客户编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="客户编码长度不能超过20个字符")
    private String customerCode;



    /**
	 * 客户名称;来源于base_customer.customer_name;readonly
	 */
    @NotBlank(message="客户名称不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="客户名称长度不能超过40个字符")
    private String customerName;



    /**
	 * 客户联系人;来源于base_customer.customer_contact_name;readonly
	 */
    @NotBlank(message="客户联系人不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="客户联系人长度不能超过40个字符")
    private String customerContactName;



    /**
	 * 客户电话;来源于base_customer.customer_tel;readonly
	 */
    @NotBlank(message="客户电话不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="客户电话长度不能超过40个字符")
    private String customerContactTel;



    /**
	 * 送货地址;来源于base_customer.customer_add;readonly
	 */
    @NotBlank(message="送货地址不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="送货地址长度不能超过40个字符")
    private String customerContactAdd;



    /**
	 * 单据类型:1-销售发货单-SEND;2-销售补货-REPAIR-;3-销售退货-RETURN
	 */
    @NotNull(message="单据类型不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Integer deliverType;



    /**
	 * 订单状态:1-未审核-WAITCHECK;2-已审核-AUDITED-;99-已作废-INVALID;readonly
	 */
    @NotNull(message="订单状态不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Integer deliverState;



    /**
	 * 审核人ID
	 */
    private Long checkUserId;



    /**
	 * 审核人;readonly
	 */
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="审核人长度不能超过40个字符")
    private String checkUserName;



    /**
	 * 审核时间;format:yyyy-MM-dd HH:mm:ss;readonly
	 */
    @JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
    private Date checkDate;


    /**
     * 销售发货单明细
     */
    @TableField(exist = false)
    private List<DeliverLineEntity> deliverLineEntityList;
}
